<?php
/**
 * Created by PhpStorm.
 * UsersF: Mloong
 * Date: 2019/4/15
 * Time: 10:01
 */

namespace app\common\controller;


use app\common\service\registeredPhoneService;
use app\common\validate\PhoneValidate;

class RegisteredPhone
{
    /**
     * @param $arr 传入一个数组，查询每个手机号码的放款记录
     * @return {"type": "贷款类型", "phone_arr":"手机号码数组", "user":"user模型对象"}
     * @throws \app\lib\exception\ParameterException
     */
    public function getRegisteredPhoneMoney($arr,$type,$logo,$toJson=false)
    {
        $check_arr = (new PhoneValidate()) ->checkPhone($arr);
        $service = new registeredPhoneService($check_arr, $type, $logo);
        $data = $service->getData();
        if($toJson == true){
            return json($data);
        }
        return $data;
    }
}